'''
@project:pythonProjectT174
@auther:zhongyingjie
@file:run_testcasenew.py
@date:2022/11/4 15:21
@desc:
'''
import time


import unittest

from common.HTMLTestRunnerNew import HTMLTestRunner
from testcases import qddenglu


def create_suite():
    suite=unittest.TestSuite()
    # suite.addTest(selenium10.BaiduSearch('test_search_01'))
    # suite.addTest(selenium10.BaiduSearch('test_search_02'))
    # suite.addTest(selenium11.Baiduclj('testxw'))
    # suite.addTest(selenium11.Baiduclj('testhao123'))

    return suite
def load_testcase():
    case_dir= 'F:\\csxm\\tinyshop_t174\\testcases\\'
    suite=unittest.TestSuite()
    load=unittest.defaultTestLoader.discover(start_dir=case_dir,pattern='tysphd*.py',top_level_dir=None)
    suite.addTests(load)
    return suite

reports_dir= 'F:\\csxm\\tinyshop_t174\\reports\\'
now=time.strftime('%Y-%m-%d-%H-%M-%S')
report_name='tingshopdl.html'
fp=open(reports_dir+now+report_name,'wb+')
runner=HTMLTestRunner(stream=fp,description='这是tinyshop登录的测试报告',title='这是tinyshop登录的测试报告')
runner.run(load_testcase())


# unittest.main(defaultTest='load_testcase')